<template>
	<view class="public_padding120">
		<view class="policyBd width92 marginTop10">
			<rich-text :nodes="content"></rich-text>
		</view>
		<view class="pubBottomFixed flex_spaceBetween marginTop10">
			<button class="public_button flex_center payPopup_payBtnHeight50 pubBtnWidth45_colorFFF" @click="navigatorToPage">返回</button>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				content:"",
			}
		},
		onLoad(query) {
			let title ="",type = "";
			switch(query.type*1){
				case 1:
				title = "平台规则";
				type= "ptgz"
				break;
				case 2:
				title = "用户协议";
				type= "yhxy"
				break;
				case 3:
				title = "隐私协议";
				type= "ysxy"
				break;
				case 4:
				title = "法律条款";
				type= "fltk"
				break;
				case 5:
				title = "付费会员服务协议";
				type= "vip"
				
			}
			this.getAgreementInfo(type)
			
			uni.setNavigationBarTitle({
				title: title
			});
		},
		methods: {
			//点击回到上个页面
			navigatorToPage() {
				uni.navigateBack({
					delta: 1
				});
			},
			//获取协议
			getAgreementInfo(type){
				this.$api.get(this.$url.common.getAgreementInfo + type).then(res=>{
					if(res.code == 200){
						if(res.data && res.data.content) {
							this.content = this.$util.setArticleDetailImgSize(res.data.content)
						}
						
					}
				})
			}
		}
	}
</script>

<style scoped>
.pubBottomFixed {
		background: transparent;
		box-shadow:none;
	}
	.policyBd {
		font-size: 14px;
		color: #333;
		margin-bottom: 30px;
	}
</style>
